//
//  CommonTools.swift
//  TrafficViolation
//
//  Created by eaglelive on 2017/4/11.
//  Copyright © 2017年 eaglelive. All rights reserved.
//

import UIKit
import Alamofire
import ReachabilitySwift
var payNo = ""//正在支付的订单编号
var payMoney = ""//正在支付金额
let WX_APPID = "wxe829bd02d95b39b5"//微信支付
let PUSH_APPKEY = "3c97a6b3fe027ff4604a72ec"//极光推送
let appID = "1252934377"//本项目在appstore中的id
var isUpdate = false//判断是否有更新

let reachability = Reachability()!//检测网络

let userDefault = UserDefaults.standard
var userID = userDefault.object(forKey: "userID")//用户ID
var tokenID = userDefault.object(forKey: "tokenID")//登录标识
let localVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
var isEmployee = userDefault.object(forKey: "isEmployee")as? String ?? "1"//是否是员工登录 1普通用户 2 员工
let deviceID = UIDevice.current.identifierForVendor?.uuidString.replacingOccurrences(of: "-", with: "")//设备号
let alertTitle = "通知"//提示框标题
var pageTag = "0"//当前tab的tag
let netNotice = "暂无网络，请检查网络连接"
let toast = LoadingView() //自定义提示框


//let projectUrl = "http://192.168.10.140:8080/ios/\(localVersion)/\(deviceID!)" //内网访问后台接口地址
let projectUrl = "http://www.hnchewutong.cn:8080/vil/ios/\(localVersion)/\(deviceID!)" //外网
let appMainColor = UIColor(red: 52/255.0, green: 152/255.0, blue: 219/255.0, alpha: 1.0)//项目主色调
let statusBarColor = UIColor(red: 9/255.0, green: 120/255.0, blue: 195/255.0, alpha: 1.0)//状态栏颜色
let tableBgColor = UIColor(red: 243/255, green: 243/255, blue: 243/255, alpha: 1)//表格背景色
let separatorColor = UIColor(red: 223/255, green: 223/255, blue: 223/255, alpha: 1)//分割线颜色
let placeholderColor = UIColor(red: 160/255, green: 160/255, blue: 160/255, alpha: 0.5)//textview  placeholder 字体颜色
let fontColor = UIColor(red: 38/255, green: 144/255, blue: 218/255, alpha: 1)
let alphaBg = UIColor(red: 0/255, green: 0/255, blue: 0/255, alpha: 0.1)  //半透明背景
let kScreenW = UIScreen.main.bounds.width
let kScreenH = UIScreen.main.bounds.height

var kStatusBarH : CGFloat = 20 //状态栏高度
let kNavigationBarH : CGFloat = 44 //导航栏高度
let kTabBarH : CGFloat = 49 //工具栏高度

let headers: HTTPHeaders = [
    "Accept": "application/json"
]
let modelName = UIDevice.current.model
//格式化颜色
func colorFromHex(_ hexString: UInt32) ->(UIColor) {
    let red     = CGFloat((hexString & 0xFF0000) >> 16) / 255.0
    let green   = CGFloat((hexString & 0x00FF00) >> 8 ) / 255.0
    let blue    = CGFloat((hexString & 0x0000FF)      ) / 255.0
    return UIColor(red: red, green: green, blue: blue, alpha: 1.0)
}
// 获取当前时间
func getCurrentTime() -> String{
    
    let date = NSDate.init(timeIntervalSinceNow: 0)
    let a = date.timeIntervalSince1970;
    let b = Int(a)
    let str = "\(b)"
    return str
}
let app = UIApplication.shared.delegate as! AppDelegate

//其它订单提交页面、实名认证、车辆认证
let oLabelW:CGFloat = 80
let oLabelH:CGFloat = 20
let oLabelLeft:CGFloat = 5
let oTop:CGFloat = 15
let oImgLeft:CGFloat = 80
let oImgW:CGFloat = (kScreenW - 80)*0.8
let oImgH:CGFloat = 0.6*oImgW
let oFontSize = UIFont.systemFont(ofSize: 14)
let remarkH:CGFloat = 60
//上传图片提醒view 高度
let commonViewH:CGFloat = 90
//单元行高度
let cellH:CGFloat = 40
//点击按钮中心点Y坐标 选择图片loading显示使用
var centerY:CGFloat = 0

var currentTagY:CGFloat = 0.0 //键盘弹起时使用
